package org.csu.question.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import org.aspectj.weaver.patterns.TypePatternQuestions;

import java.time.LocalDateTime;

// 答题记录实体
@Data
@TableName("answer_records")
public class AnswerRecord {
    @TableId(type = IdType.AUTO)
    private Long id;

    @TableField("user_id")
    private Long userId;

    @TableField("question_id")
    private Long questionId;

    @TableField("user_answer")
    private String userAnswer;

    @TableField("is_correct")
    private Boolean isCorrect;

    @TableField("time_cost")
    private Integer timeCost; // 答题耗时(秒)

    @TableField(value = "answered_at", fill = FieldFill.INSERT)
    private LocalDateTime answeredAt;

    // 非数据库字段
    @TableField(exist = false)
    private Questions question;

    @TableField(exist = false)
    private User user;
}
